package com.wjjun.utils;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import me.tatarka.bindingcollectionadapter2.LayoutManagers;

/**
 *
 * Created by 67535 on 2019/1/26.
 */

public class MulGridLayoutManager {

    public static LayoutManagers.LayoutManagerFactory grid(final int spanCount, final GridLayoutManager.SpanSizeLookup spanSizeLookup) {
        return new LayoutManagers.LayoutManagerFactory() {
            @Override
            public RecyclerView.LayoutManager create(RecyclerView recyclerView) {
                GridLayoutManager gridLayoutManager = new GridLayoutManager(recyclerView.getContext(), spanCount);
                gridLayoutManager.setSpanSizeLookup(spanSizeLookup);
                return gridLayoutManager;
            }
        };
    }
}
